<?php 
/**
 * 路由处理
 * @author Yuwei(yuwei1122@gmail.com)
 *
 */
class BluePhp_Core_Auth
{
	/**
	 * 路由
	 */
	public static function auth()
	{
		$REQUEST_URI = $_SERVER['REQUEST_URI'];
		if($REQUEST_URI)
		{
			$array = explode('?', $REQUEST_URI);
			if(isset($array[0]))
			{
				$part = explode('/', trim($array[0],'/'));
				$_GET['a'] = isset($part[0])?$part[0]:'';
				$_GET['f'] = isset($part[1])?$part[1]:'';
				for ($i = 2;$i < count($part);)
				{
					if(isset($part[$i]) && isset($part[$i + 1]))
					{
						$_GET[$part[$i]] = $part[$i + 1];
						$i += 2;
					}
				}
			}
			if(isset($array[1]))
			{
				$part = explode('&', trim($array[1],'/'));
				foreach ($part as $one)
				{
					$array = explode('=', $one);
					if(isset($array[0]) && isset($array[1]))
						$_GET[$array[0]] = $array[1];
				}
			}
		}
	}
}
?>